package com.qf.tenement.tenement_rent.controller;

import com.qf.tenement.tenement_entity.ResultData;
import com.qf.tenement.tenement_rent.Renting;
import com.qf.tenement.tenement_rent.service.RentListService;
import com.qf.tenement.tenement_rent.service.SearchService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
public class SearchController {
    @Resource
    private SearchService searchService;


    @GetMapping("/cha")
    public ResultData cha(String key){
        Iterable<Renting> all = searchService.findAll(key);
        return ResultData.createSuccessJsonResult(all);
    }

    @GetMapping("/jia")
    public Boolean parse() throws Exception {
        return searchService.paeseConten();
    }


}
